﻿using System;
using Test30.Core;
using Test30.Data;
using Test30.Engine;

namespace Test30.Cmd
{
    class Class4
    {
        public Class4()
        {
            var content = DataFiles.Load();
            var hero = Hero.CreateTemp();

            var game = new Game(hero, content);
            ProcessGame(game);
        }

        private void ProcessGame(Game game)
        {
            GameResult result = new GameResult();
            while (!result.NeedsAction && !result.IsGameOver)
            {
                result = game.Process();
                if (result.CheckForCancel) game.CanelAction();
            }
        }

    }
}
